import api from '@/api'

const state = {
    tableData: {
        total: 0,
        accounts: [],
    },
}
const mutations = {
    setData(state, payload) {
        if (payload.data) {
            state.tableData = payload.data
        }
    },
}
const actions = {
    // 用户名片接口
    async query_user_data({ commit }, obj) {
        let result = await api.workbench.query_user_data(obj)
        return result
    },
    // 统计区域
    async count_order_status({ commit }, obj) {
        let result = await api.workbench.count_order_status(obj)
        return result
    },
    // 平台公告
    async query_inventory({ commit }, obj) {
        let result = await api.workbench.query_inventory(obj)
        return result
    },
    // 消息通知列表接口
    async get_message_total({ commit }, obj) {
        let result = await api.workbench.get_message_total(obj)
        return result
    },

    // 即将到期、已超期、我的待办、我分配的
    async task_list_code({ commit }, obj) {
        let result = await api.workbench.task_list_code(obj)
        return result
    },
    // 即将到期、已超期、我的待办、我分配的下面列表复选框---任务已完成、任务未完成、激活任务接口
    async complete_task_service({ commit }, obj) {
        let result = await api.workbench.complete_task_service(obj)
        return result
    },

    // 我的账户--账户金额统计查询
    async get_account_money_statistical({ commit }, obj) {
        let result = await api.workbench.get_account_money_statistical(obj)
        return result
    },

    // 在办订单
    async get_product_model_by_status({ commit }, obj) {
        let result = await api.workbench.get_product_model_by_status(obj)
        return result
    },

    // 用户消息已读
    async read_msg({ commit }, obj) {
        let result = await api.workbench.read_msg(obj)
        return result
    },

}
const getters = {}

export default {
    namespaced: true,
    state,
    actions,
    mutations,
    getters,
}